// ******************************************************************
// * Copyright(c)  Steven Lu
// * Description   : Entity_PROD_WO_MTRL
// * CreateDate    : 2014-06-05 18:30:22
// * Creater       : CodeSmith
// * LastChangeDate: 2014-06-05 18:30:22
// * LastChanger   : 2014-06-05 18:30:22
// * Version Info  : 1.0 For ESOL
// ******************************************************************

using System;
using System.Data;
using System.Collections.Generic;
using System.Text;
using System.Runtime.Serialization;
using Suzsoft.Smart.EntityCore;
using ESOL.Common.Schema;
using ESOL.Common;

namespace ESOL.Common.Entity
{
    [DataContract]
	[Serializable]
	public partial class ProdWoMtrlEntity : EntityBase
    {
        public ProdWoMtrlTable TableSchema
        {
            get
            {
                return ProdWoMtrlTable.Current;
            }
		}
		
		public ProdWoMtrlEntity()
        {

        }
		
		public ProdWoMtrlEntity(DataRow dr)
        {
			if(dr == null)
			{
				return;
			}
			this.WoNo = Convert.ToString(CommonFunctions.ToObject(dr["Wo_No"]));
			this.MtrlId = Convert.ToString(CommonFunctions.ToObject(dr["Mtrl_Id"]));
			this.MtrlCode = Convert.ToString(CommonFunctions.ToObject(dr["Mtrl_Code"]));
			this.MtrlName = Convert.ToString(CommonFunctions.ToObject(dr["Mtrl_Name"]));
			this.ReqQty = Convert.ToDecimal(CommonFunctions.ToObject(dr["Req_Qty"]));
			this.UsedQty = Convert.ToDecimal(CommonFunctions.ToObject(dr["Used_Qty"]));
			this.OutQty = Convert.ToDecimal(CommonFunctions.ToObject(dr["Out_Qty"]));
			this.ScrapQty = Convert.ToDecimal(CommonFunctions.ToObject(dr["Scrap_Qty"]));
			this.ReturnQty = Convert.ToDecimal(CommonFunctions.ToObject(dr["Return_Qty"]));
			this.Unit = Convert.ToString(CommonFunctions.ToObject(dr["Unit"]));
			this.Id = Convert.ToString(CommonFunctions.ToObject(dr["ID"]));
			this.UnitQty = Convert.ToDecimal(CommonFunctions.ToObject(dr["UNIT_QTY"]));
			this.PoNo = Convert.ToString(CommonFunctions.ToObject(dr["PO_NO"]));
			this.ItemType = Convert.ToString(CommonFunctions.ToObject(dr["ITEM_TYPE"]));
        }
		
		public ProdWoMtrlEntity(DataRowView dr)
        {
			if(dr == null)
			{
				return;
			}
			this.WoNo = Convert.ToString(CommonFunctions.ToObject(dr["Wo_No"]));
			this.MtrlId = Convert.ToString(CommonFunctions.ToObject(dr["Mtrl_Id"]));
			this.MtrlCode = Convert.ToString(CommonFunctions.ToObject(dr["Mtrl_Code"]));
			this.MtrlName = Convert.ToString(CommonFunctions.ToObject(dr["Mtrl_Name"]));
			this.ReqQty = Convert.ToDecimal(CommonFunctions.ToObject(dr["Req_Qty"]));
			this.UsedQty = Convert.ToDecimal(CommonFunctions.ToObject(dr["Used_Qty"]));
			this.OutQty = Convert.ToDecimal(CommonFunctions.ToObject(dr["Out_Qty"]));
			this.ScrapQty = Convert.ToDecimal(CommonFunctions.ToObject(dr["Scrap_Qty"]));
			this.ReturnQty = Convert.ToDecimal(CommonFunctions.ToObject(dr["Return_Qty"]));
			this.Unit = Convert.ToString(CommonFunctions.ToObject(dr["Unit"]));
			this.Id = Convert.ToString(CommonFunctions.ToObject(dr["ID"]));
			this.UnitQty = Convert.ToDecimal(CommonFunctions.ToObject(dr["UNIT_QTY"]));
			this.PoNo = Convert.ToString(CommonFunctions.ToObject(dr["PO_NO"]));
			this.ItemType = Convert.ToString(CommonFunctions.ToObject(dr["ITEM_TYPE"]));
        }

        public override TableInfo OringTableSchema
        {
            get
            {
                return ProdWoMtrlTable.Current;
            }
        }
		
		#region Perporty List
        [DataMember]
        public string WoNo
        {
            get { return Convert.ToString(GetData(ProdWoMtrlTable.C_Wo_No)); }
            set { SetData(ProdWoMtrlTable.C_Wo_No, value); }
        }
		
        [DataMember]
        public string MtrlId
        {
            get { return Convert.ToString(GetData(ProdWoMtrlTable.C_Mtrl_Id)); }
            set { SetData(ProdWoMtrlTable.C_Mtrl_Id, value); }
        }
		
        [DataMember]
        public string MtrlCode
        {
            get { return Convert.ToString(GetData(ProdWoMtrlTable.C_Mtrl_Code)); }
            set { SetData(ProdWoMtrlTable.C_Mtrl_Code, value); }
        }
		
        [DataMember]
        public string MtrlName
        {
            get { return Convert.ToString(GetData(ProdWoMtrlTable.C_Mtrl_Name)); }
            set { SetData(ProdWoMtrlTable.C_Mtrl_Name, value); }
        }
		
        [DataMember]
        public decimal ReqQty
        {
            get { return Convert.ToDecimal(GetData(ProdWoMtrlTable.C_Req_Qty)); }
            set { SetData(ProdWoMtrlTable.C_Req_Qty, value); }
        }
		
        [DataMember]
        public decimal UsedQty
        {
            get { return Convert.ToDecimal(GetData(ProdWoMtrlTable.C_Used_Qty)); }
            set { SetData(ProdWoMtrlTable.C_Used_Qty, value); }
        }
		
        [DataMember]
        public decimal OutQty
        {
            get { return Convert.ToDecimal(GetData(ProdWoMtrlTable.C_Out_Qty)); }
            set { SetData(ProdWoMtrlTable.C_Out_Qty, value); }
        }
		
        [DataMember]
        public decimal ScrapQty
        {
            get { return Convert.ToDecimal(GetData(ProdWoMtrlTable.C_Scrap_Qty)); }
            set { SetData(ProdWoMtrlTable.C_Scrap_Qty, value); }
        }
		
        [DataMember]
        public decimal ReturnQty
        {
            get { return Convert.ToDecimal(GetData(ProdWoMtrlTable.C_Return_Qty)); }
            set { SetData(ProdWoMtrlTable.C_Return_Qty, value); }
        }
		
        [DataMember]
        public string Unit
        {
            get { return Convert.ToString(GetData(ProdWoMtrlTable.C_Unit)); }
            set { SetData(ProdWoMtrlTable.C_Unit, value); }
        }
		
        [DataMember]
        public string Id
        {
            get { return Convert.ToString(GetData(ProdWoMtrlTable.C_ID)); }
            set { SetData(ProdWoMtrlTable.C_ID, value); }
        }
		
        [DataMember]
        public decimal UnitQty
        {
            get { return Convert.ToDecimal(GetData(ProdWoMtrlTable.C_UNIT_QTY)); }
            set { SetData(ProdWoMtrlTable.C_UNIT_QTY, value); }
        }
		
        [DataMember]
        public string PoNo
        {
            get { return Convert.ToString(GetData(ProdWoMtrlTable.C_PO_NO)); }
            set { SetData(ProdWoMtrlTable.C_PO_NO, value); }
        }
		
        [DataMember]
        public string ItemType
        {
            get { return Convert.ToString(GetData(ProdWoMtrlTable.C_ITEM_TYPE)); }
            set { SetData(ProdWoMtrlTable.C_ITEM_TYPE, value); }
        }
		
		#endregion
	}
	
	
}	

